<%-- 
    Document   : dictionaryExample
    Created on : Dec 12, 2009, 11:10:45 AM
    Author     : ppt
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
        <title>Translation example II</title>
        <script type="text/javascript" src="js/jquery-1.2.6.min.js"></script>
        <script type="text/javascript" src="js/jquery.translate-1.1.6.js"></script>
        <script type="text/javascript">
                function startTranslation(fromlang, tolang, fromId, toId){

                         var sourceText = $('#'+fromId).val();

                         $.translate(sourceText, fromlang, tolang, {

                                start:          function() {   $('#throbber').show() },

                                complete:    function(translation) { $('#'+toId).val(translation); $('#throbber').hide(); },

                                error:         function() {   $('#throbber').hide()   }

                        });

                }
        </script>
</head>
<body>
        <p>Original text<p>
        <textarea rows="10" cols="60" id="text1" ></textarea>
        <br/>
        <span id="throbber" style="display:none;">Translating...</span>
        <p>Translated text</>
        <textarea rows="10" cols="60" id="text2"></textarea>
<br>
<input type="button" onclick="javascript:TranslateTextArea2('es', 'pt-PT', 'text1', 'text2');" value="Translate Es to Pt" />
<br>
<input type="button" onclick="javascript:TranslateTextArea2('es', 'fr', 'text1', 'text2');" value="Translate Es to Fr" />
</body>
</html>
